<?php if (!defined('THINK_PATH')) exit(); /*a:2:{s:80:"D:\phpstudy_pro\WWW\thinkphp\public/../application/admin\view\analysis\user.html";i:1649398768;s:68:"D:\phpstudy_pro\WWW\thinkphp\application\admin\view\common\meta.html";i:1647074041;}*/ ?>
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
<title><?php echo $System['SiteName']['value']; ?></title>

<meta name="keywords" content="<?php echo $System['keywords']['value']; ?>" />
<meta name="description" content="<?php echo $System['description']['value']; ?>" />
<link rel="shortcut icon" href="<?php echo $System['SiteLogo']['value']; ?>" />

<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
<meta http-equiv="Cache-Control" content="no-siteapp" />

<link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
<link rel="stylesheet" href="/assets/admin/css/font.css">
<link rel="stylesheet" href="/assets/admin/css/xadmin.css">

<script src="/assets/admin/js/jquery.min.js"></script>
<script src="/assets/admin/lib/layui/layui.js" charset="utf-8"></script>
<script type="text/javascript" src="/assets/admin/js/xadmin.js"></script>
</head>

<body>
    <div class="x-body">

        <!-- 为 ECharts 准备一个具备大小（宽高）的 DOM元素 -->
        <!-- 按分类统计帖子 -->
        <div id="cate" style="width: 100%;height:700px;"></div>


    </div>
</body>

</html>
<script src="/assets/admin/js/echarts.min.js"></script>
<script>
    //获取数据
    var vip = []
    var data = []

    var catelist = `<?php echo $catelist; ?>`
    //将json转为 JS 数组
    catelist = JSON.parse(catelist);
    for (key in catelist) {
        vip.push({
            value: key,
            groupId: catelist[key]
        })
        data.push(catelist[key]);
    }
    data.sort()
    //基于准备好的dom，初始化echarts实例
    var chartDom = echarts.init(document.getElementById('cate'));

    var option = {
        xAxis: {
            data: data
        },
        yAxis: {},
        dataGroupId: '',
        animationDurationUpdate: 500,
        series: {
            type: 'bar',
            id: 'sales',
            data: vip,
            universalTransition: {
                enabled: true,
                divideShape: 'clone'
            }
        }
    };
    

    option && chartDom.setOption(option);

</script>